<?php

namespace app\Admin\model;

use think\Model;

class Subjects extends Model
{
    //定义主键
    protected $pk ='id';
    //定义表
    protected $table = 'art_subjects';
    //设置隐藏字段
    protected $hidden = ['status'];
    /**
     * 设置与作品的一对多关联
     */
    public function works(){
        $this->hasMany('works','subject_id','id');
    }
}
